zloo	
	lda _checkjoy
	beq ffe4zuo
	tay
	lda #0
	sta _checkjoy
	tya
	jmp _qqq

ffe4zuo	jsr $ffe4
_qqq	cmp #17    ;crsr
	bne _x
	jsr zakminus
	jsr rysuj

_x 	cmp #29  ;crsr
	bne _s
	jsr zakplus
	jsr rysuj

_s 	cmp #134 ;f3
	bne _spc
	jsr stop

_spc 	cmp #133 ;f1
	bne _ret
	jsr init

_ret cmp #136    ; f7
	bne _ret2
	jsr tuneload

_ret2 cmp #13    ; return
	bne _pause
	jsr tuneload

_pause  cmp #135  ; f5
	bne _v
         lda graj
         eor #1
         sta graj
         beq _jgra
         lda #iplay
	 jmp _jgra2
_jgra 	 lda #ipause
_jgra2   sta $6c00-1
	jsr reset_sid

_v	cmp #86 ;v
	bne _t
	jsr __v

_t	cmp #84 ;t
	bne _e
	jsr __t

_e	cmp #69 ;e
	bne _leftar
	jsr __e

_leftar cmp #95 ; left arrow
	bne _jb1	
	jsr jboxtoggle

_jb1    cmp #49   ; 1 , 2 , 3 mines for jukebox
	bne _jb2	
	jsr jbox1
_jb2    cmp #50 
	bne _jb3	
	jsr jbox2
_jb3    cmp #51 
	bne _EXIT	
	jsr jbox3


_EXIT         cmp #171 ; c= + q
         bne _end
         jmp $fce2


_end 	jmp zloo

		
loadptr   .byte 0
hid	.byte

__v
	lda #1
	sta hid
___x	rts
__t	lda hid
	cmp #1
	bne ___x
	inc hid
	rts
__e	lda hid
	cmp #2
	bne ___x
	jmp hidden
	


;----- Paragraph @ckhkey - check kbd@ -----
;
zakminus
	lda liczba
	cmp #1
	beq zplus2
        clc
        sbc #0
        sta liczba
;       dec $d020
zplus2	rts

zakplus
	lda liczba
	cmp #67	; 69
	beq zmin2
        sec
        adc #0
        sta liczba
;       inc $d020
zmin2	rts

